// copyright 1999 Idocs, Inc. http://www.idocs.com
// Distribute this script freely but keep this notice in place
function numbersonly(myfield, e, dec)
{
var key;
var keychar;

if (window.event)
   key = window.event.keyCode;
else if (e)
   key = e.which;
else
   return true;
keychar = String.fromCharCode(key);

// control keys
if ((key==null) || (key==0) || (key==8) || 
    (key==9) || (key==13) || (key==27) )
   return true;

// numbers
else if ((("0123456789").indexOf(keychar) > -1))
   return true;

// decimal point jump
else if (dec && (keychar == "."))
   {
   myfield.form.elements[dec].focus();
   return false;
   }
else
   return false;
}


function isNull(val){
    //return(val==null);
    alert ("This is a Javascript Alert");
}

function textboxControl(val){
   
   if(val == null){
      alert ("Field can not be left empty.");
      return false;

   }
   else if(val == ""){
      alert ("Field can not be left empty.");
      return false;
   }
   else{
      return true;
   }
    
}

function radioControl(radioObj){
   //alert (radioObj);
   var checkedValue = getCheckedValue(radioObj);
   
   if(checkedValue == null){
      alert ("You must make a selection.");
      return false;

   }
   else if(checkedValue == ""){
      alert ("You must make a selection.");
      return false;
   }
   else{
      return true;
   }
    
}

function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}

function uyar(){
   alert ("***.");
}

